#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(improper_ctypes)]

#[cfg(feature = "android")]
pub mod android {
	pub mod api_level {
		include!("android/api-level.rs");
	}
	pub mod ndk_version {
		include!("android/ndk-version.rs");
	}
	include!("android/rect.rs");
	pub mod trace {
		include!("android/trace.rs");
	}
	pub mod versioning {
		include!("android/versioning.rs");
	}
	pub mod abort {
		include!("android/set_abort_message.rs");
	}
	pub mod asset {
		use super::super::{off64_t, off_t};
		use jnim_sys::*;
		include!("android/asset_manager.rs");
		include!("android/asset_manager_jni.rs");
	}
	#[cfg(feature = "bitmap")]
	pub mod bitmap {
		use jnim_sys::*;
		include!("android/bitmap.rs");

		#[cfg(target_os = "android")]
		#[link(name = "jnigraphics")]
		extern "C" {}
	}
	pub mod choreographer {
		include!("android/choreographer.rs");
	}
	pub mod configuration {
		use super::asset::AAssetManager;
		include!("android/configuration.rs");
	}
	pub mod data_space {
		include!("android/data_space.rs");
	}
	pub mod dlext {
		use super::super::off64_t;
		include!("android/dlext.rs");
	}
	pub mod fdsan {
		include!("android/fdsan.rs");
	}
	pub mod file {
		use jnim_sys::*;
		include!("android/file_descriptor_jni.rs");
	}
	pub mod hardware_buffer {
		use super::ARect;
		use jnim_sys::*;
		include!("android/hardware_buffer.rs");
		include!("android/hardware_buffer_jni.rs");
	}
	pub mod hdr_metadata {
		include!("android/hdr_metadata.rs");
	}
	pub mod imagedecoder {
		use super::ARect;
		include!("android/imagedecoder.rs");
	}
	pub mod input {
		use super::looper::{ALooper, ALooper_callbackFunc};
		use jnim_sys::*;
		include!("android/input.rs");
		include!("android/keycodes.rs");
	}
	#[cfg(feature = "log")]
	pub mod log {
		use super::super::va_list;
		include!("android/log.rs");

		#[cfg(target_os = "android")]
		#[link(name = "log")]
		extern "C" {}
	}
	pub mod looper {
		include!("android/looper.rs");
	}
	pub mod network {
		include!("android/multinetwork.rs");
	}
	#[cfg(feature = "window")]
	pub mod activity {
		use super::asset::AAssetManager;
		use super::input::AInputQueue;
		use super::window::ANativeWindow;
		use super::ARect;
		use jnim_sys::*;
		include!("android/native_activity.rs");
	}
	#[cfg(feature = "window")]
	pub mod window {
		use super::ARect;
		use jnim_sys::*;
		include!("android/native_window.rs");
		include!("android/native_window_jni.rs");
		include!("android/window.rs");

		#[cfg(target_os = "android")]
		#[link(name = "nativewindow")]
		extern "C" {}
	}
	pub mod obb {
		include!("android/obb.rs");
	}
	pub mod performance {
		include!("android/performance_hint.rs");
	}
	pub mod permission {
		include!("android/permission_manager.rs");
	}
	pub mod sensor {
		use super::looper::{ALooper, ALooper_callbackFunc};
		include!("android/sensor.rs");
	}
	pub mod memory {
		use jnim_sys::*;
		include!("android/sharedmem.rs");
		include!("android/sharedmem_jni.rs");
	}
	pub mod storage {
		include!("android/storage_manager.rs");
	}
	#[cfg(feature = "window")]
	pub mod surface {
		use super::choreographer::AVsyncId;
		use super::data_space::ADataSpace;
		use super::hardware_buffer::AHardwareBuffer;
		use super::hdr_metadata::{AHdrMetadata_cta861_3, AHdrMetadata_smpte2086};
		use super::window::ANativeWindow;
		use super::ARect;
		use jnim_sys::*;
		include!("android/surface_control.rs");
		include!("android/surface_texture.rs");
		include!("android/surface_texture_jni.rs");
	}
	pub mod thermal {
		include!("android/thermal.rs");
	}
	#[cfg(feature = "sync")]
	pub mod sync {
		include!("android/sync.rs");

		#[cfg(target_os = "android")]
		#[link(name = "sync")]
		extern "C" {}
	}
	#[cfg(feature = "neural")]
	pub mod neural {
		use super::hardware_buffer::AHardwareBuffer;
		include!("android/NeuralNetworks.rs");
		include!("android/NeuralNetworksTypes.rs");

		#[cfg(target_os = "android")]
		#[link(name = "neuralnetworks")]
		extern "C" {}
	}

	#[cfg(target_os = "android")]
	#[link(name = "android")]
	extern "C" {}
}

#[cfg(feature = "audio")]
pub mod aaudio {
	include!("aaudio/AAudio.rs");

	#[cfg(target_os = "android")]
	#[link(name = "aaudio")]
	extern "C" {}
}

#[cfg(feature = "midi")]
pub mod amidi {
	use jnim_sys::*;
	include!("media/NdkMediaError.rs");
	include!("amidi/AMidi.rs");

	#[cfg(target_os = "android")]
	#[link(name = "amidi")]
	extern "C" {}
}

#[cfg(feature = "media")]
pub mod media {
	use super::android::hardware_buffer::AHardwareBuffer;
	use super::{off64_t, off_t};
	use error::*;
	include!("media/NdkImage.rs");
	include!("media/NdkMediaCodec.rs");
	include!("media/NdkMediaDataSource.rs");
	include!("media/NdkMediaFormat.rs");
	include!("media/NdkImageReader.rs");
	include!("media/NdkMediaCrypto.rs");
	include!("media/NdkMediaDrm.rs");
	include!("media/NdkMediaExtractor.rs");
	include!("media/NdkMediaMuxer.rs");
	pub mod error {
		include!("media/NdkMediaError.rs");
	}

	#[cfg(target_os = "android")]
	#[link(name = "mediandk")]
	extern "C" {}
}

#[cfg(feature = "camera")]
pub mod camera {
	use super::android::window::ANativeWindow;
	use error::*;
	use jnim_sys::*;
	include!("camera/NdkCameraCaptureSession.rs");
	include!("camera/NdkCameraMetadata.rs");
	include!("camera/NdkCameraWindowType.rs");
	include!("camera/NdkCameraDevice.rs");
	include!("camera/NdkCameraManager.rs");
	include!("camera/NdkCameraMetadataTags.rs");
	include!("camera/NdkCaptureRequest.rs");
	pub mod error {
		include!("camera/NdkCameraError.rs");
	}

	#[cfg(target_os = "android")]
	#[link(name = "camera2ndk")]
	extern "C" {}
}

pub type off64_t = i64;

#[cfg(target_arch = "aarch64")]
pub type off_t = i64;

#[cfg(target_arch = "x86_64")]
pub type off_t = i64;

#[cfg(target_arch = "arm")]
pub type off_t = i32;

#[cfg(target_arch = "x86")]
pub type off_t = i32;
#[cfg(target_arch = "wasm32")]
pub type off_t = i32;

#[cfg(target_arch = "aarch64")]
pub type va_list = [u64; 4usize];

#[cfg(target_arch = "x86_64")]
pub type va_list = [__va_list_tag; 1usize];
#[cfg(target_arch = "x86_64")]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __va_list_tag {
	pub gp_offset: ::core::ffi::c_uint,
	pub fp_offset: ::core::ffi::c_uint,
	pub overflow_arg_area: *mut ::core::ffi::c_void,
	pub reg_save_area: *mut ::core::ffi::c_void,
}

#[cfg(target_arch = "arm")]
pub type va_list = u32;

#[cfg(target_arch = "x86")]
pub type va_list = *mut c_char;
#[cfg(target_arch = "wasm32")]
pub type va_list = *mut i32;
